In a video encoding system, motion estimation technology is utilized for determining a relative motion vector between an image and its adjacent image in a video stream. In many video encoding systems (such as the system which is compatible to H.264 or MPEG-4), a motion estimation method is usually adopted for assisting in finding dependency between different images, and applications of image compression, content analysis, etc. can be further achieved.
In generally, current image processing technology acquires the most appropriate motion vector, representing a relative shift of an area to be matched (a matching window) in two different images, by block matching. FIG. 1(A) is a schematic diagram of a motion vector V of the prior art. As shown in FIG. 1(A), the motion vector V is utilized for representing a vector corresponding to horizontal and vertical shift of a specific block between the prior image and the present image (referring to the motion vector V in FIG. 1(A)). In practice, the most commonly used block-matching discrepancy calculation method is Sum of Absolute Difference (SAD).
Among all kinds of motion vector estimation methods, motion vector cost function is a preferred estimation method, and the formula is as follows.Motion vector cost function=A×(mvbits[cx-px]+mvbits[cy-py])
Wherein, A is a scaling factor; [cx,cy] is a motion vector of a search candidate position; [px,py] is a motion vector of a predictor position; mvbits[cx-px] is a estimation value of bits of the differential value of the above two motion vectors in x direction, hereinafter a motion vector bits mvbits[cx-px]; mvbits[cy-py] is a estimation value of bits of the differential value of the above two motion vectors in y direction, hereinafter a motion vector bits mvbits[cx-px]. Take mvbits[k] as an example, the relative relationship between the bit estimation value and an absolute value |k| is shown in FIG. 1(B).
FIG. 1(C) is a schematic diagram of a circuit frame of a conventional motion vector cost function generator. As shown in FIG. 1(C), a motion vector cost function generator 3 comprises a first subtraction unit 30, a second subtraction unit 31, a first motion vector bit estimation unit 32, a second motion vector bit estimation unit 33, an addition unit 34 and a multiplication unit 35.
First, the subtraction unit 30 calculates the differential value [cx-px] according to an x component cx of the motion vector [cx,cy] of the search candidate position and an x component px of the motion vector [px,py] of the predictor position. The second subtraction unit 31 calculates the differential value of the [cy-py] according to a y component cy of the motion vector [cx,cy] of the search candidate position and a y component py of the motion vector [px,py] of the predictor position. Subsequently, the first motion vector bit estimation unit 32 calculates the motion vector bits mvbits[cx-px] according to the differential value of the [cx-px]; and the second motion vector bit estimation unit 33 calculates the motion vector bits mvbits[cy-py] according to the differential value of the [cy-py]. Afterwards, the addition unit 34 adds mvbits[cx-px] to mvbits[cy-py] and obtains a result of (mvbits[cx-px]+mvbits[cy-py]). Finally, the multiplication unit 35 multiplies the value of (mvbits[cx-px]+mvbits[cy-py]) by the scaling factor A and obtains the motion vector cost function.
However, the circuit frame of the conventional motion vector cost function generator 3 has a defect that it needs to conduct complex multiplications by the high level multiplication unit 35, hence resulting in problems of time limit and increase of logic degree, etc.
Therefore, a motion estimation apparatus and method thereof are provided, for resolving the above problems.